package com.shxzz.easy12306.services.pay.service.payid;

import org.springframework.stereotype.Component;

/**
 * 支付 ID 生成器
 *
 * @author shxzz
 * @create 2024-03-09-21:02
 */
@Component
public class PayIdGenerator {

    private final Snowflake snowflake = new Snowflake();

    /**
     * 根据基因法生成的订单号生成支付ID
     */
    public String getPayId(String orderSn) {
        return snowflake.nextIdStr() + orderSn.substring(orderSn.length()-6);
    }

}
